/*
 * GLCommonStop.h
 *
 *  Created on: Oct 31, 2014
 *      Author: yuliang
 */

#ifndef GLCOMMONSTOP_H_
#define GLCOMMONSTOP_H_

#include "LogicBase/GLContainerBase.h"
#include "GLGoodsCommodity.h"

class CGLCommonStop : public CGLContainerBase {
public:
	CGLCommonStop(UserId_t id);
	virtual ~CGLCommonStop();

//	virtual bool DecodeContainerExtend(const std::string& info) { return false; }
//	virtual bool EncodeContainerExtend(std::string& info) { return true; }
	virtual bool DecodeGoodsExtend(uint8_t box, Index_t index, const std::string& info);
	virtual bool EncodeGoodsExtend(CGLGoodsBase*, std::string& info);

	Gold_t BuyCommodity(uint8_t box, Index_t index, Number_t num);
	const CGLGoodsBase& GetCurGoods() const { return m_CurGoods; }
protected:
	// 新建物品,并初始化
	virtual CGLGoodsBase* getGoods();
	virtual void setGoods(CGLGoodsBase* goods);
	virtual const GoodsFixInfo* getGoodsFixInfo(Type_t type) const;
private:
	uint8_t					m_CurBox;
	Index_t					m_CurIndex;
	CGLGoodsBase			m_CurGoods;
};

#endif /* GLCOMMONSTOP_H_ */
